[SPARK-29494][SQL][2.4] Fix for ArrayOutofBoundsException while converting string to timestamp#26171
Closed
rahulsmahadev wants to merge 2 commits intoapache:branch-2.4from
Closed
[SPARK-29494][SQL][2.4] Fix for ArrayOutofBoundsException while converting string to timestamp#26171rahulsmahadev wants to merge 2 commits intoapache:branch-2.4from
rahulsmahadev wants to merge 2 commits intoapache:branch-2.4from
Conversation
Contributor
Author
|
cc @zsxwing |
Member
|
ok to test |
|
Test build #112305 has finished for PR 26171 at commit
|
MaxGekk
approved these changes
Oct 19, 2019
srowen
approved these changes
Oct 19, 2019
srowen
pushed a commit
that referenced
this pull request
Oct 19, 2019
…rting string to timestamp ### What changes were proposed in this pull request? * Adding an additional check in `stringToTimestamp` to handle cases where the input has trailing ':' * Added a test to make sure this works. ### Why are the changes needed? In a couple of scenarios while converting from String to Timestamp `DateTimeUtils.stringToTimestamp` throws an array out of bounds exception if there is trailing ':'. The behavior of this method requires it to return `None` in case the format of the string is incorrect. ### Does this PR introduce any user-facing change? No ### How was this patch tested? Added a test in the `DateTimeTestUtils` suite to test if my fix works. Closes #26171 from rahulsmahadev/araryOB. Authored-by: Rahul Mahadev <rahul.mahadev@databricks.com> Signed-off-by: Sean Owen <sean.owen@databricks.com>
Member
|
Merged to 2.4. Thank you @rahulsmahadev @zsxwing |
Member
|
Thank you all! |
scunniff
pushed a commit
to scunniff/nomad-spark
that referenced
this pull request
Nov 10, 2020
…rting string to timestamp ### What changes were proposed in this pull request? * Adding an additional check in `stringToTimestamp` to handle cases where the input has trailing ':' * Added a test to make sure this works. ### Why are the changes needed? In a couple of scenarios while converting from String to Timestamp `DateTimeUtils.stringToTimestamp` throws an array out of bounds exception if there is trailing ':'. The behavior of this method requires it to return `None` in case the format of the string is incorrect. ### Does this PR introduce any user-facing change? No ### How was this patch tested? Added a test in the `DateTimeTestUtils` suite to test if my fix works. Closes apache#26171 from rahulsmahadev/araryOB. Authored-by: Rahul Mahadev <rahul.mahadev@databricks.com> Signed-off-by: Sean Owen <sean.owen@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
stringToTimestampto handle cases where the input has trailing ':'Why are the changes needed?
In a couple of scenarios while converting from String to Timestamp
DateTimeUtils.stringToTimestampthrows an array out of bounds exception if there is trailing ':'. The behavior of this method requires it to returnNonein case the format of the string is incorrect.Does this PR introduce any user-facing change?
No
How was this patch tested?
Added a test in the
DateTimeTestUtilssuite to test if my fix works.